function change_info(id){
    let opacity = 0;
    var form = document.getElementById(id);
    form.style.opacity = opacity;

    form.style.display = form.style.display == 'none' ? 'block' : 'none';
    if(form.style.display == 'block'){
        this.innerHTML = '取消修改';
        const interval = setInterval(function(){
            if(opacity < 1){
                opacity += 0.25;
                form.style.opacity = opacity;
            }else{
                clearInterval(interval);
            }
        }, 50);
    }
}

function change_order(id){
    var f = document.getElementById(id);
    var names = f.querySelectorAll('[name]');
    var uname = names[1].value;
    //去除空格
    uname = uname.replace(/\s+/g, '');
    if(uname == ''){
        alert('收货人不可为空');
        return false;
    }
    var uaddr = names[2].value;
    uaddr = uaddr.replace(/\s+/g, '');
    if(uaddr == ''){
        alert('收货地址不可为空');
        return false;
    }
    var uphone = names[3].value;
    uphone = uphone.replace(/\s+/g, '');
    if(uphone == ''){
        alert('手机号不可为空');
        return false;
    }
    //正则判断手机号格式
    var reg = /^1[3456789]\d{9}$/;
    if(!reg.test(uphone)){
        alert('手机号格式不正确');
        return false;
    }

}